﻿/**********************************弘石项目*******************************************
* 功能描述: 系统设置  机构设置:人员 培训，常用设置
* 作者:石锦涛
* 时间:2021-12-21
* 
**********************************弘石项目*******************************************/
using HongStone.Domain.AttendanceManagement;
using HongStone.Domain.OperationsManagement;
using HongStone.Domain.SystemSetupModel.FrequentlyUsedDataModel;
using HongStone.Domain.SystemSetupModel.InstitutionSettingModel;
using HongStone.Dto;
using HongStone.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HongStone.Service
{
    public class SystemManagementSJTBll
    {
        private readonly SystemManagementSJTDal _systemManagementSJTDal;
        public SystemManagementSJTBll(SystemManagementSJTDal systemManagementSJTDal)
        {
            _systemManagementSJTDal = systemManagementSJTDal;
        }

        /// <summary>
        /// 人员信息显示
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="bum"></param>
        /// <param name="name"></param>
        /// <param name="state"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public List<StaffShowDto> Showstaff(out int totalCount, int? bum, string name, int? state, int pageindex = 1, int pagesize = 5)
        {
            try
            {
                return _systemManagementSJTDal.Showstaff(out totalCount, bum, name, state, pageindex, pagesize);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 人员信息添加
        /// </summary>
        /// <param name="staff"></param>
        /// <returns></returns>
        public int AddStaff(Staff staff)
        {
            try
            {
                return _systemManagementSJTDal.AddStaff(staff);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 显示详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Staff ShowstaffDetails(int id)
        {
            try
            {
                return _systemManagementSJTDal.ShowstaffDetails(id);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 人员信息修改
        /// </summary>
        /// <param name="staffst"></param>
        /// <returns></returns>
        public int UpdateStaff(Staff staffst)
        {
            try
            {
                return _systemManagementSJTDal.UpdateStaff(staffst);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 人员批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int staffDate(string ids)
        {
            try
            {
                return _systemManagementSJTDal.staffDate(ids);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 培训信息列表
        /// </summary>
        /// <param name="bum"></param>
        /// <param name="xingzhi"></param>
        /// <param name="yeary"></param>
        /// <param name="month"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        public ResultData ShowTrains(int? bum, string xingzhi, int? yeary, string  month, string content)
        {
            try
            {
                return _systemManagementSJTDal.ShowTrains(bum, xingzhi, yeary, month, content);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 培训添加
        /// </summary>
        /// <param name="showTrainDto"></param>
        /// <returns></returns>
        public ResultData AddTrains(ShowTrainDto showTrainDto)
        {
            try
            {

                return _systemManagementSJTDal.AddTrains(showTrainDto);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 显示人员
        /// </summary>
        /// <returns></returns>
        public List<StaffShowDto> Showren(int? bum)
        {
            try
            {
                return _systemManagementSJTDal.Showren( bum);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 修改培训
        /// </summary>
        /// <param name="showTrainDto"></param>
        /// <returns></returns>
        public int Updateshuju(ShowTrainDto showTrainDto)
        {

            try
            {
                return _systemManagementSJTDal.Updateshuju(showTrainDto);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 删除培训
        /// </summary>
        /// <param name="TrainOneId"></param>
        /// <returns></returns>
        public int Deteltesc(int TrainOneId)
        {
            try
            {
                return _systemManagementSJTDal.Deteltesc(TrainOneId);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 字典显示
        /// </summary>
        /// <returns></returns>
       
        public List<DictionariesDto> ShowDiction(out int totalCount, string names, int pageindex = 1, int pagesize = 5)
        {
            try
            {
                return _systemManagementSJTDal.ShowDiction(out totalCount, names, pageindex, pagesize);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 字典添加
        /// </summary>
        /// <param name="dictionaries"></param>
        /// <returns></returns>
        public ResultData Diction(DictionariesTable dictionaries)
        {
            try
            {
                return _systemManagementSJTDal.Diction(dictionaries);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 字典修改
        /// </summary>
        /// <param name="dictionaries"></param>
        /// <returns></returns>
        public int Update(DictionariesTable dictionaries)
        {
            try
            {
                return _systemManagementSJTDal.Update(dictionaries);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 字典 批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int DeteleteDict(string ids)
        {
            try
            {
                return _systemManagementSJTDal.DeteleteDict(ids);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 链接显示
        /// </summary>
        /// <returns></returns>
        public List<FastLink> ShowLink()
        {
            try
            {
                return _systemManagementSJTDal.ShowLink();
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 添加快捷链接
        /// </summary>
        /// <param name="fast"></param>
        /// <returns></returns>
        public int AddLinke(FastLink fast)
        {
            try
            {
                return _systemManagementSJTDal.AddLinke(fast);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 删除链接
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleteLink(int id)
        {
            try
            {
                return _systemManagementSJTDal.DeleteLink(id);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 显示工资
        /// </summary>
        /// <returns></returns>
        public List<StaffSalary> staffwageshuju()
        {
            try
            {
                return _systemManagementSJTDal.staffwageshuju();
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 导入 上传 Excel 工资
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public int Uploading(List<StaffSalary> user)
        {
            try
            {
                return _systemManagementSJTDal.Uploading(user);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 显示职称
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<PositionMessage> ShowPositions(string name)
        {
            try
            {
                return _systemManagementSJTDal.ShowPositions(name);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 职称添加
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public int AddPositions(PositionMessage position)
        {
            try
            {
                return _systemManagementSJTDal.AddPositions(position);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 修改职称数据
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public int UpdatePositions(PositionMessage position)
        {
            try
            {
                return _systemManagementSJTDal.UpdatePositions(position);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 批量删除职称
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int DeletPositions(string ids)
        {
            try
            {
                return _systemManagementSJTDal.DeletPositions(ids);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 显示项目奖金统计
        /// </summary>
        /// <returns></returns>
        public List<BonusCoefficient> ShowBonus()
        {
            try
            {
                return _systemManagementSJTDal.ShowBonus();
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 系数奖金修改
        /// </summary>
        /// <param name="bonus"></param>
        /// <returns></returns>
        public int UpdateBonus(List<BonusCoefficient> bonus)
        {
            try
            {
                return _systemManagementSJTDal.UpdateBonus(bonus);
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 人员信息显示
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="bum"></param>
        /// <param name="names"></param>
        /// <param name="yeays"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public List<StaffShowDto> ShowRatkStaff(out int totalCount, int? bum, string names, string yeays, int pageindex = 1, int pagesize = 10)
        {
            try
            {
                return _systemManagementSJTDal.ShowRatkStaff(out totalCount, bum, names, yeays, pageindex, pagesize);
                    
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 显示级别
        /// </summary>
        /// <returns></returns>
        public List<DictionariesTable> ShowDictions()
        {
            return _systemManagementSJTDal.ShowDictions();
        }

        /// <summary>
        /// 修改级别
        /// </summary>
        /// <param name="zhi"></param>
        /// <param name="jibie"></param>
        /// <returns></returns>
        public int Updateshujib(int zhi, int jibie)
        {
            try
            {
                return _systemManagementSJTDal.Updateshujib(zhi, jibie);
            }
            catch (Exception)
            {

                throw;
            }
        }

    }
}
